version: '3.7'
services:
  redis:
    image: redis:latest
    container_name: redis
    ports:
      - "6379:6379"
    restart: always
    networks:
      - skynet

  api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: api
    env_file: .env
    ports:
      - "8081:8081"
    environment:
      - API_KEY=${API_KEY}
      - API_LINK=${API_LINK}
      - MODEL=${MODEL}
      - PORT=${PORT}
      - REDIS_HOST=redis
      - PROXY_URL=${PROXY_URL}
      - PROXY_USER=${PROXY_USER}
      - PROXY_PASSWORD=${PROXY_PASSWORD}

    restart: always
    depends_on:
      - redis
    networks:
      - skynet
networks:
  skynet:

